import { createApp } from 'vue'
import App from '@/App.vue'
import router from '@/router'
import { Toast, Button, Icon, Dialog, Loading, Image } from 'vant'
import 'lib-flexible' //自动计算html的根值
import '@CSS/reset.css'
import '@CSS/global.less'
import '@vant/touch-emulator' // 桌面端touch适配
import 'vant/lib/index.css'
import MyIcon from '@C/MyIcon/MyIcon'
import * as directives from '@/utils/directive' // 自定义指令

const app = createApp(App)

// 注册全局自定义指令
Object.entries(directives).forEach(([key, val]) => app.directive(key, val))

app.use(router)
app.use(Toast).use(Button).use(Icon).use(Dialog).use(Loading).use(Image)
app.component('MyIcon', MyIcon)
app.mount('#app')
